
add_executable(transpose transpose.cu)
target_link_libraries(transpose PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(transpose PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(transpose PRIVATE -lineinfo)

add_executable(combined_access combined_access.cu)
target_link_libraries(combined_access PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(combined_access PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(combined_access PRIVATE -lineinfo)


add_executable(my_transpose_v1_naive my_transpose_v1_naive.cu)
target_link_libraries(my_transpose_v1_naive PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v1_naive PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v1_naive PRIVATE -lineinfo)

add_executable(my_transpose_v2_float4 my_transpose_v2_float4.cu)
target_link_libraries(my_transpose_v2_float4 PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v2_float4 PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v2_float4 PRIVATE -lineinfo)

add_executable(my_transpose_v3_float2 my_transpose_v3_float2.cu)
target_link_libraries(my_transpose_v3_float2 PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v3_float2 PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v3_float2 PRIVATE -lineinfo)

add_executable(my_transpose_v4_float2_1x2 my_transpose_v4_float2_1x2.cu)
target_link_libraries(my_transpose_v4_float2_1x2 PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v4_float2_1x2 PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v4_float2_1x2 PRIVATE -lineinfo)

add_executable(my_transpose my_transpose.cu)
target_link_libraries(my_transpose PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose PRIVATE -lineinfo)

add_executable(roofline_model roofline_model.cu)
target_link_libraries(roofline_model PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(roofline_model PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(roofline_model PRIVATE -lineinfo)

add_executable(my_transpose_v5_shared_memory my_transpose_v5_shared_memory.cu)
target_link_libraries(my_transpose_v5_shared_memory PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v5_shared_memory PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v5_shared_memory PRIVATE -lineinfo)

add_executable(my_transpose_v6_no_bank_conflict my_transpose_v6_no_bank_conflict.cu)
target_link_libraries(my_transpose_v6_no_bank_conflict PRIVATE CUDA::cudart ${CUDA_cublas_LIBRARY})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(my_transpose_v6_no_bank_conflict PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-G>)
endif()
target_compile_options(my_transpose_v6_no_bank_conflict PRIVATE -lineinfo)